/**
 * 
 */
package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author yexijiang
 * @date Jul 3, 2008
 */
public class DBConnect 
{

	public static Connection connect(String url, String usr, String pwd)
	{
		String sLocation = "org.gjt.mm.mysql.Driver";
		Connection conn = null;
		try {
			Class.forName(sLocation);
			conn = DriverManager.getConnection(url, usr, pwd);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return conn;
	}
	
}
